package com.seafwg.store.mapper;

import com.seafwg.store.entity.User;

import java.util.Date;

/**
 * @Author seafwg
 * @Date 2022/3/25 12:14 上午
 * @Version 1.0
 * @description xxx
 */

public interface UserMapper {

    /**
     * 插入用户
     * @param user
     * @return
     */
    Integer insert(User user);

    /**
     * 根据用户名称查询用户
     * @param username
     * @return
     */
    User findUserByUsername(String username);

    /**
     * 更新用户密码
     * @param uid
     * @param password
     * @param modifiedUser
     * @param modifiedTime
     * @return
     */
    Integer updateUserPasswordByUid(Integer uid, String password, String modifiedUser, Date modifiedTime);

    /**
     * 根据用户的uid查询用户
     * @param uid
     * @return
     */
    User findUserByUid(Integer uid);

    /**
     * 根据uid更新用户个人资料
     * @param user
     * @return
     */
    Integer updateUserByUid(User user);

    /**
     * 根据用户uid修改头像
     * @param uid
     * @param avatar
     * @param modifiedUser
     * @param modifiedTime
     * @return
     */
    Integer updateUserAvatarByUid(Integer uid, String avatar, String modifiedUser, Date modifiedTime);
}
